<template lang="">
    <div>
        <div>
              <elBread></elBread>
              <el-button class="xb" type="primary" size="small"  plain @click="addDialog">添加</el-button>
              <list @edit="edit"></list>
              <Dialog ref="diaInfo" @cancel="cancel" :addInfo="addInfo"></Dialog>
        </div>
    </div>
</template>
<script>
import list from './list.vue'
import Dialog from './dialog.vue'
export default {
    data() {
        return {
            addInfo:{
            isAdd: true,//true 添加
            isShow: false,//用来控制弹框的显示隐藏
            
        }
        }

    },
    methods: {
    addDialog() {
      //打开弹框
      this.addInfo.isShow = true;
      //告诉弹框你是个添加
      this.addInfo.isAdd = true;
    },
    //关闭弹框
    cancel(e) {
      this.addInfo.isShow = e;
    },
    //编辑
    edit(e) {
      //打开弹框
      this.addInfo.isShow = true;
      //告诉弹框你是个编辑
      this.addInfo.isAdd = false;
      this.$refs.diaInfo.lookup(e)
    },
  },
  components: {
    list,
    Dialog,
  },
}
</script>
<style lang="less">
.xb {
    margin: 10px 5px;
}
</style>